﻿using Bricks.Business.Models.Account;
using Bricks.Component.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;

namespace Bricks.Business.Models.Account
{
    [Description("功能")]
    public class ActionInfo : EntityBase<Guid>
    {
        public ActionInfo()
        {
            ID = GuidHelper.NewGuid();
        }

        [Required]
        [StringLength(32)]
        [Display(Name = "功能名称")]
        public string ActionName { get; set; }

        [StringLength(64)]
        [Display(Name = "功能编码")]
        public string ActionCode { get; set; }

        public ActionType ActionType
        {
            get
            {
                return (ActionType)ActionTypeNum;
            }
            set
            {
                ActionTypeNum = (int)value;
            }
        }

        [Display(Name = "功能类型")]
        public int ActionTypeNum { get; set; }

        [StringLength(1024)]
        [Display(Name = "图标")]
        public string Icon { get; set; }

        [Display(Name = "排序")]
        public int OrderNo { get; set; }

        [StringLength(1024)]
        [Display(Name = "描述")]
        public string Description { get; set; }

        #region Collection
        //public virtual ICollection<UserInfo> Users { get; set; }

        //public virtual ICollection<MenuInfo> Menus { get; set; }
        #endregion
    }
}
